# -*- coding: utf-8 -*-
from pyecharts.charts import Bar
from pyecharts import options as opts
 
 
def draw_bar(all_list):
    print("开始绘图")
    attr = ["海沧", "湖里", "集美", "思明", "翔安", "同安"]
    v0 = all_list[0]
    v1 = all_list[1]
    v2 = all_list[2]
    v3 = all_list[3]
 
    bar = Bar()
    bar.add_xaxis(attr)
    bar.add_yaxis("min",v0)
    bar.add_yaxis("max",v1)
    bar.add_yaxis("mean",v2)
    bar.add_yaxis("mid",v3)
    bar.set_global_opts(title_opts=opts.TitleOpts(title="厦门市租房租金概况"))
    # bar.add("最小值", attr, v0, is_stack=True)
    # bar.add("最大值", attr, v1, is_stack=True)
    # bar.add("平均值", attr, v2, is_stack=True)
    # bar.add("中位数", attr, v3, is_stack=True)
    bar.render()
    print("结束绘图")